package Nisha.JDBCdemo;

/*
sql injection. 

- most of the websites have this problem. - where in url th user passes the wrong values.
to avoid this we sud not be using query directly. stmt.setString helps in this case.

insert 100 employees 
one is to prepared statments

bulk data can be processed using batch. JDBC supports it*/

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class jdbcGetConnection {

private static final String conString = "jdbc:mysql://localhost:3306/office";
	
    public Connection getMySQLConnection() throws SQLException {
            return DriverManager.getConnection(conString, "root", "12345");
    }
    
    public Connection getOracleConnection() throws SQLException
    {
    
    	 return DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:<port>:<sid>", "root", "12345");
    }
}
